﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;

namespace MonitorAPI.Controllers
{
    public class QueryTestController : ApiController
    {
        [HttpGet]
        [Route("api/query/monitorPoints")]
        public HttpResponseMessage shutup()
        {
            var list =
              MetroDataQuery.Utility.MonitorPointsQuery.GetPointsValueByDate(17, "沉降", "下行线", "2012-11-27", true);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, list);
            return response;
        }


        [HttpGet]
        [Route("api/query/originTime")]
        public string originTime()
        {
            return MetroDataQuery.Utility.MonitorPointsQuery.GetOriginTime(17, "沉降", "下行线");
        }

        [HttpGet]
        [Route("api/query/go")]
        public string go()
        {
            var names = new string[10];
            var values = new double[10];
            var reviews = new bool[10];

            for (var i = 0; i < 10; i++)
            {
                names[i] = "XX" + i.ToString("00");
                values[i] = i;
                reviews[i] = true;
            }
            MetroDataQuery.Utility.UpdateMonitorPointQuery.UpdatePoints(17, "2014-10-25", names, values, reviews);
            return "hahaha";
        }
    }
}